<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>后台</title>
	 <link rel="stylesheet" type="text/css" href="/css/css.css">
	 <link rel="stylesheet" type="text/css" href="/font-awesome-4.7.0/css/font-awesome.min.css">
	 <link  rel="stylesheet" type="text/css" href="/css/lyz.calendar.css" />
     <script src='/js/vue/vue.js'></script>
     <script src='/js/jquery.js'></script>
     <script src='/js/layer.js'></script>
</head>

<body>
	{include file='index/public/header'}
<div class="left">
{include file='index/public/left'}
</div>
<div id="right">
	<a href="javascript:;" id="fabu" @click='stand_add()'><font style='font-weight:bold;font-size:18px;position:relative;top:2px;'>+</font> 添加规格</a>
<table width="84.8%" border="0" cellspacing="0" cellpadding="0" class="list" >
		<tr style='background:#f2f6fc;height:30px;font-size:13px;color:#666;'>
			<th class="bgtt" width="3%" >ID号</th>
      <th class="bgtt" width='10%'>规格名称</th>
      <th class="bgtt"  style='text-align:center;'>规格选项</th>
			<th class="bgtt" width="20%" style='text-align:left;'>操作</th>
		</tr>
{volist name="stand" id="vo" }
    <tr style='font-size:13px;text-align:center;height:40px;color:#666;'>
     <td  style='color:#666;' >{$vo.id}</td>
     <td>{$vo.stand_name}{if $vo.stand_notes!=''}<font style='color:orange;'>[{$vo.stand_notes}]</font>{/if}</td>
     <td  style='color:#666;text-align:left;' class='stand'>
  {foreach $vo.stand_list as $k=>$v}
        <span>&nbsp;{$v}&nbsp;</span>
  {/foreach}
     </td>
     <td style='margin-left:100px;text-align:left;'><a href='javascript:;' class='admin_edit' @click='stand_edit({$vo.id})' >修改</a> <a href='javascript:;'  class='admin_del' @click='stand_delt({$vo.id})'>删除</a></td>
</tr>
{/volist}

		</table>

</div>
</body>
</html>
<script>
   new Vue({
     el:"#right",
     data:{
       
     },methods:{
        stand_add(){
            layer.open({
               type: 2,
               title: '添加规格页',
               shadeClose: true,
               shade: 0.1,
               area: ['70%', '80%'],
               content: '/admin.php/stand/stand_add' //iframe的url
             }); 
        },stand_edit(id){
            layer.open({
               type: 2,
               title: '修改规格页',
               shadeClose: true,
               shade: 0.1,
               area: ['70%', '80%'],
               content: '/admin.php/stand/stand_add?id='+id //iframe的url
             }); 
        },stand_delt(id){
               layer.confirm('确定删除ID号为‘'+id+'’的分类?', {
                      btn: ['确定','取消'] //按钮
                   }, function(){
                    layer.msg('正在删除...', {time: 20000,icon:16});
                       $.ajax({
                           url:'/admin.php/stand/stand_delt',
                           data:{id:id},
                           dataType:'json',
                           type:'post',
                           success:function(res){
                              if(res.status=='ok'){
                                   layer.msg('删除成功！', {time: 1500,icon:1});
                              }else{
                                  layer.msg('删除失败！', {time: 1500,icon:7});
                              }
                             setTimeout(function(){
                               if(res.status=='ok'){
                                 window.location.reload();
                               }
                               larey.closeAll();
                             },1600);

                           }
                       }); 
                    }, function(){
                       layer.closeAll();
              });
        }
     }
   });
</script>
<style>
  tr{
    border-bottom:1px solid #ccc;
    }
    .right_main  table tr:hover{
       cursor:pointer;
       background:#efefef;
    }
    .inputtext{
       width:30px;
       height:20px;
    }
.save{
  float:right;
}
   .num{
       width:25px;
       height:20px;
       text-align:center;
       line-height:25px;
       margin-left:25px;
       margin-top:3px;
   }

    .admin_edit,.admin_del{border-radius:3px;}
    .admin_edit{
        border:1px solid green;
	color:green;
    }
    .admin_del{
       border:1px solid orange;
	color:orange;
    }
     #fabu{
      background: #09C878;
    padding: 0 10px 0 10px;
    color: #fff;
    float: right;
    margin: 8px 0px 10px 0;
    height: 26px;
    min-width: 26px;
    _width: 10px;
    line-height: 25px;
    border: 1px solid #00c874;
    border-radius: 18px;
    font-size: 12px
    }
    .stand span{
        float:left;
        height:26px;
        text-align:center;
        line-height:26px;
        border:1px solid #efefef;
        border-radius:3px;
        margin-left:5px;
    }
</style>
